From: Owen W. Taylor Date: Tue, 20 May 2014 01:34:04 +0000 (-0400) Subject: Scripting: exit if the perf script throws an error during collection X-Git-Tag: archive/raspbian/50.5-1+rpi1~1^2~1013^2^2~2369 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=910c95fa9bab1183edf88e605cdee6e46a7dfbf3;p=gnome-shell.git Scripting: exit if the perf script throws an error during collection If an exception occurs while collecting parameters, exit rather than just leaving the shell running in the main loop. https://bugzilla.gnome.org/show_bug.cgi?id=732349 --- diff --git a/js/ui/scripting.js b/js/ui/scripting.js index 1da99d977..72f670261 100644 --- a/js/ui/scripting.js +++ b/js/ui/scripting.js @@ -360,7 +360,12 @@ function runPerfScript(scriptModule, outputFile) { _step(g, function() { - _collect(scriptModule, outputFile); + try { + _collect(scriptModule, outputFile); + } catch (err) { + log("Script failed: " + err + "\n" + err.stack); + Meta.exit(Meta.ExitCode.ERROR); + } Meta.exit(Meta.ExitCode.SUCCESS); }, function(err) {